package com.xyy.enums;

/**
 * 活动状态枚举
 */
public enum ActivityStatus {
    
    /**
     * 待审核 - 普通管理员发布后等待超级管理员审核
     */
    PENDING_AUDIT("PENDING_AUDIT", "待审核"),
    
    /**
     * 已通过 - 超级管理员审核通过，用户和医生可见
     */
    APPROVED("APPROVED", "已通过"),
    
    /**
     * 已拒绝 - 超级管理员审核拒绝
     */
    REJECTED("REJECTED", "已拒绝");
    
    private final String code;
    private final String description;
    
    ActivityStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据代码获取枚举
     */
    public static ActivityStatus fromCode(String code) {
        for (ActivityStatus status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown activity status code: " + code);
    }
}
